package j.framework.tags;

import j.util.DES;
import j.util.StringUtils;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;

/**
 * 注释模板
 */
public class RequestTag extends SimpleTagSupport {

    private String rid;

    @Override
    public void doTag() throws JspException, IOException {
        if(StringUtils.isNullOrEmpty(rid)){
            return;
        }
        StringBuilder s = new StringBuilder("/user/req?rid=");
        s.append(DES.encrypt(rid));
        getJspContext().getOut().write(s.toString());
    }

    public void setRid(String rid) {
        this.rid = rid;
    }
}
